package com.lagou.edu.service.impl;

import com.lagou.edu.pojo.AuthCode;
import com.lagou.edu.pojo.Token;
import com.lagou.edu.service.CodeFeignClient;
import org.springframework.stereotype.Component;
import org.springframework.ui.ModelMap;

@Component
public class CodeFeignFallback implements CodeFeignClient {

    @Override
    public ModelMap checkCode(AuthCode authCode) {
        ModelMap modelMap = new ModelMap();
        modelMap.addAttribute("code", 500);
        modelMap.addAttribute("message", "调用失败");
        return modelMap;
    }

    @Override
    public ModelMap sendEmail(AuthCode authCode) {
        ModelMap modelMap = new ModelMap();
        modelMap.addAttribute("code", 500);
        modelMap.addAttribute("message", "调用失败");
        return modelMap;
    }

    @Override
    public Long saveToken(Token token) {
        return -1L;
    }

    @Override
    public String getToken(Token token) {
        return "获取 token 失败";
    }

    @Override
    public String getEmail(Token token) {
        return "获取 email 失败";
    }

}
